import matplotlib.pyplot as plt
import numpy as np

# Data for the chart
workloads = ['30%', '60%', '90%']
origin_throughput = [3.2994, 6.4574, 8.2639]
diffcs_throughput = [3.2992, 6.4586, 8.2676]

# Bar width
bar_width = 0.3
index = np.arange(len(workloads))

# Plotting
fig, ax = plt.subplots(figsize=(8, 6))

plt.tick_params(labelsize=25)
font1 = {'weight' : 'normal','size' : 30,}
X_name = "Workload"
plt.xlabel(X_name, fontdict=font1)
Y_name = "Avg Throughput (Gbps)"
plt.ylabel(Y_name, fontdict=font1)
ax.set_xticks(index) 
ax.set_xticklabels(workloads)

ax.set_ylim(0, 10)

ax.grid(True, axis='y', linestyle='--', linewidth=0.7)  # Gridlines for the y-axis with dashed lines


spacing = 0.0
bars1 = ax.bar(index - bar_width / 2 - spacing / 2, origin_throughput, bar_width, label='HPCC', color='white', edgecolor='#4169e1', linewidth=3)
bars2 = ax.bar(index + bar_width / 2 + spacing / 2, diffcs_throughput, bar_width, label='DiffHPCC', color='white', edgecolor='#4169e1', hatch='\\', linewidth=3)


# Legend
plt.legend(loc='best', ncol=1, prop={'size': 24})

# Show the plot
plt.tight_layout()
png_filename = 'V2_hpcc.pdf'
plt.savefig(png_filename, format='pdf', dpi=300, bbox_inches='tight')